package com.dodoke.service.impl;

import com.dodoke.beans.CakeCatalog;
import com.dodoke.mapper.CakeCatalogMapper;
import com.dodoke.service.CakeCatelogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CakeCatalogServiceImpl implements CakeCatelogService {

    @Autowired
    private CakeCatalogMapper cakecatelogmapper;

    @Override
    public void add(CakeCatalog cakeCatalog) {
        cakecatelogmapper.insert(cakeCatalog);
    }

    @Override
    public void remove(int id) {
        cakecatelogmapper.delete(id);
    }
    //按id查看分类
    @Override
    public CakeCatalog get(int id) {
        return cakecatelogmapper.select(id);
    }
    //超看所有分类
    @Override
    public List<CakeCatalog> getAll() {
        return cakecatelogmapper.selectAll();
    }
}
